/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package umled.model;
import java.io.*;
import java.awt.*;
import org.w3c.dom.*;
/**
 *
 * @author ANor
 */
public class UMLModel extends UMLPackage {
    public UMLModel(String s, int x, int y, int w, int h){
        super(s, null, x, y, w, h);
    }
    @Override
    public void draw(Graphics2D g2d, int x, int y){
        int xDr = Math.min( x, getX() + getWidth());
        int yDr = Math.min( y, getY() + getHeight());
        for(UMLElement e: getInnerPackages())
            e.draw(g2d, xDr, yDr);
        for(UMLElement e: getTypes())
            e.draw(g2d, xDr, yDr);
    }
    public void load( File f ){
        //TODO
    }
    public void save( File f ){
        //TODO
    }
    @Override
    public Element getXML( Document document ){
        Element element = super.getXML( document );
        element.setAttribute( "type" , "UMLModel" );
        return element;
    }
}
